package com.vivid.system;

import com.vivid.system.controller.ModelController;
import com.vivid.system.controller.PredictionController;
import com.vivid.system.controller.ToolController;
import com.vivid.system.controller.UserController;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;

import java.text.ParseException;
import java.time.LocalDateTime;
import java.util.Date;

@WebAppConfiguration
@SpringBootTest
@RunWith(SpringJUnit4ClassRunner.class)
public class Mytest {
    @Autowired
    private UserController userController;
    @Autowired
    private ToolController toolController;
    @Autowired
    private PredictionController predictionController;
    @Autowired
    private ModelController modelController;

    @Test
    public void testUser() {

        System.out.println(userController.getInfo(1L));
    }

    @Test
    public void testDate() throws ParseException {
//        String date = toolController.StrToDate("2022-8-5 11:23:09");
//        System.out.println("转化后格式为"+date);
//        LocalDateTime localDateTime = LocalDateTime.now();
//        System.out.println("时间：" + new Date());
//        Date date = new Date(1660141322911L);
        System.out.println("输出的时间为"+new Date(System.currentTimeMillis()));

    }

    @Test
    public void testPythonModel() {
        System.out.println("长度" + toolController.readTxt("D:\\model_storage\\model.txt").size());

    }



}
